package com.lanou3g.hw0420;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by dllo on 18/4/20.
 */
public class Server {
    public static void main(String[] args) {
        try {
            ServerSocket ss=new ServerSocket(2333);
            System.out.println("服务器已启动,等待连接");
            while (true){
                Socket client=ss.accept();
                System.out.println("有一个用户已连接"+client.getRemoteSocketAddress());
                new EchoThread(client).start();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}
